<!DOCTYPE html>
<html>
<#include "../head.html">
<body class="full">
<div class="mc">
    <div class="mc-l">
        <!--左侧导航---{-->
        <div id="navPanelContainer">
            <div class="system-logo cd"></div>
            <!--管理员信息---{-->
            <#include "../adminInfo.html">
                <!--管理员信息---}-->
                <div class="nav-wrap">
                    <#include "left.html">
                </div>
        </div>
        <!--左侧导航---}-->
    </div>
    <div class="mc-m">
        <div class="navToggle"></div>
    </div>
    <div class="mc-r">
        <!--顶部导航---{-->
        <#include "../topNav.html">
            <!--顶部导航---}-->

            <!--面包屑导航---{-->
            <#assign moduleName="修改回款银行卡">
                <#include "banner.html">
                    <!--面包屑导航---}-->

                    <!--工具栏--{-->
                    <div id="toolbar" class="clearfix">
                        <div class="toolbor-module search">
                            <input type="button" value="搜索"  class="input-button" onclick="search();">
                        </div>
                        <div class="toolbor-module search">
                            <input type="text" class="search-value" value="请输入手机号码" id="phone" name="phone" style="color: rgb(159, 159, 159);">
                        </div>
                    </div>
                    <!--工具栏--}-->

                    <div id="main" class="clearfix">
                        <form action="" method="post">
                            <table class="data-list">
                                <tr class="header">
                                    <td>ID</td>
                                    <td>用户名</td>
                                    <td>真实姓名</td>
                                    <td>手机</td>
                                    <td>项目名称</td>
                                    <td>投资金额</td>
                                    <td>投资时间</td>
                                    <td>回款时间</td>
                                    <td>投资银行</td>
                                    <td>投资银行卡号</td>
                                    <td>修改卡号</td>
                                </tr>
                                <#if list??>
                                    <#list list as item>
                                        <tr class="s">
                                            <td>${item.id?c}</td>
                                            <td>${item.borrowTender.user.userName!''}</td>
                                            <td>${item.borrowTender.user.realName!''}</td>
                                            <td>${item.borrowTender.user.phone!''}</td>
                                            <td>${item.borrowTender.borrow.name!''}</td>
                                            <td>${item.capital!0}</td>
                                            <td>${item.borrowTender.addtime}</td>
                                            <td>${item.repayTime?string('yyyy-MM-dd')}</td>
                                            <#if item.borrowTender.bankCard??>
                                                <td>${item.borrowTender.bankCard.bankShortName}</td>
                                                <td>${item.borrowTender.bankCard.cardNo}</td>
                                                <#else>
                                                    <td>-</td>
                                                    <td>-</td>
                                            </#if>
                                            <td><a class="popConfirm" data-id="${item.borrowTender.id?c}" data-phone="${item.borrowTender.user.phone!''}"  href="javascript:;">修改</a></td>
                                            <input type='hidden' id='tenderid' value="${item.borrowTender.id!''}">
                                        </tr>
                                    </#list>
                                </#if>
                            </table>
                        </form>

                        <!--底部工具栏--{-->
                        <div id="bottomToolbar" class="clearfix">
                            <div class="other-tool">
                                <dl class="refresh-data">
                                    <dt class="refresh-data-icon"></dt>
                                    <dd><a href="javascript:void(0);" class="refresh-page">刷新数据</a></dd>
                                </dl>
                            </div>

                            <!--翻页系统--{-->
                            <div class="container s_formPage">
                                <#import "../../common/page.html" as pager>
                                    <@pager.pagination page=page url="${pageUrl}" map=param style="style1" />
                            </div>
                            <!--翻页系统--}-->
                        </div>
                        <!--底部工具栏--}-->

                        <script>
                            var urls = '?search=true';
                            function search(){
                                var phone = $("#phone").val();

                                if (phone!=null && phone!="请输入手机号码"){
                                    urls += "&phone="+phone;
                                }

                                location.href=urls;
                            }
                        </script>
                    </div>
    </div>
</div>
<div class="mc-b"><#include "../foot.html"></div>
<#include "../jsPage.html">
<script>
$(function(){
	var tenderid='';	
	$('.popConfirm').click(function(){
		var simpleWindown_html="",
		tenderid=$(this).attr('data-id'),
		tenderphone=$(this).attr('data-phone');
		alert(tenderid);
		alert(tenderphone);
		
	    simpleWindown_html = "<div id=\"windownbg\" style=\"height:"+$(document).height()+"px;filter:alpha(opacity=50);opacity:0.5;z-index: 999901;display: block;\"></div>";
	    simpleWindown_html += "<div id=\"windown-box\">";
	    simpleWindown_html += "<div id=\"windown-title\"><h2>输入卡号</h2><span id=\"windown-close\">关闭</span></div>";
	    simpleWindown_html += "<div id=\"windown-content-border\" style='padding:5px 15px'><div id=\"windown-content\">";
	    simpleWindown_html += "<div class='row' style='margin-top:10px'><label>新卡号:</label>&nbsp;&nbsp;<input id='newcard' type='text'></div>"
	    simpleWindown_html += "<div class='row' style='text-align:left' ><input id='confirmBtn' type='button' value='确认' style='margin-left:75px;text-align: left;margin-top: 19px;' /></div>";
	    simpleWindown_html += "</div></div>";
	    simpleWindown_html += "</div>";
	   	$('body').append(simpleWindown_html);
	   	$('#windown-box').css({
	   		left:'50%',
	   		top:'50%',
	   		minWidth:'280px',
	   		minHeight:'150px',
	   		zIndex:'999902'
	   	});
		$('#windown-close').click(function(){
			$('#windownbg,#windown-box').remove();
		});
		$('#confirmBtn').click(function(){
			$.ajax({
                url:"/admin/system/modifyAuthPhone.html",
                type:"post",
                data:{
                	"actionType":'modify',
                	"newcard":$('#newcard').val(),
                	"tenderid":tenderid,
                	"phone":tenderphone
                	
                },
                dataType:"json",
                async:false,
                success:function(data){
                	if(data.resultCode){
                		alert('修改成功！');
                		$('#windown-close').click();
                		 location.reload();
                	}else{
                		alert(data.resultMsg);
                	}
                	
                },
                error:function(data){
                	
                }
			});
			
		});
	});
});
</script>
</body>
</html>
